<?php 
echo previous_link($section,$action,$go,$modal_window); 
if ($msg != "default") echo $msg_output; 

if ($action == "edit") {
$query_edit = "SELECT * FROM comments WHERE id='$id'";
$edit = mysql_query($query_edit, $connection) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
}
if ($modal_window == "false") { ?>
<p><span class="icon"><img src="images/arrow_left.png" border="0" align="absmiddle" /></span><a href="index.php?section=view_proposal&cid=<?php echo $cid; ?>">Back to Proposal Overview</a></p>
<?php } 
if ($msg == "default") { ?>
<h2><?php if ($action == "edit") echo "Edit "; else echo "Add "; echo $db_friendly." Comment &mdash; ".$row_courses['jiu_course_id'].": ".$row_courses['name']; ?></h2>

<table>
	<tr>
    	<td>
        <textarea id="comment" name="comment" rows="20" cols="80"><?php if ($action == "edit") echo $row_edit['comment']; ?></textarea>
        <?php if ($dbTable != "materials") { ?>
        <div class="stacked"><span class="dataLabel">CE Changes Needed?</span><span class="data">
        <input type="radio" name="changes" value="Y" id="changes_0" <?php if (($action == "add") || ($row_edit['changes'] == "Y")) echo "CHECKED"; ?>> Yes&nbsp;&nbsp;
        <input type="radio" name="changes" value="N" id="changes_1" <?php if ($row_edit['changes'] == "N") echo "CHECKED"; ?>> No</span>
        </div>
        <div class="stacked">
        <input id="Submit" name="Submit" type="submit" class="button" value="<?php if ($action == "edit") echo "Update"; else echo "Submit Comment"; ?>" onclick="tinyMCE.triggerSave(false,true);">
        </div>
        <?php } ?>
		</td>
    	<td>
        <?php 
		if ($action == "add") {
			if ($dbTable == "project_deliverable") 		include (PROPOSAL.'display_proj_deliv.sec.php');
			elseif ($dbTable == "learning_outcomes")	include (PROPOSAL.'display_lo.sec.php');
			elseif ($dbTable == "course_description") 	include (PROPOSAL.'display_cd.sec.php'); 
			elseif ($dbTable == "course_project")		include (PROPOSAL.'display_cpd.sec.php'); 
			elseif ($dbTable == "materials")			include (PROPOSAL.'display_materials.sec.php');
			elseif ($dbTable == "readings")				include (MODULES.'display_module_readings.sec.php');
			elseif ($dbTable == "assignments")			include (MODULES.'display_module_assignments.sec.php');
			elseif ($dbTable == "themes")				include (MODULES.'display_module_themes.sec.php');
		}
		else echo "&nbsp;";
        ?>
        </td>
    </tr>
</table>
<input type="hidden" name="rid" id="rid" value="<?php if ($action == "edit") echo $row_edit['rid']; else echo $row_view_specific['id']; ?>">
<input type="hidden" name="uid" id="uid" value="<?php if ($action == "edit") echo $row_edit['uid']; else echo $row_user['id']; ?>">
<?php if ($action == "edit") { ?>
<input type="hidden" name="tableName" id="tableName" value="<?php echo $row_edit['tableName']; ?>">
<?php } ?>

<?php }
//if (($action == "add") && ($dbTable == "project_deliverable")) 	include (SECTIONS.'display_proj_deliv.sec.php');
//if (($action == "add") && ($dbTable == "learning_outcomes"))	include (SECTIONS.'display_lo.sec.php');
//if (($action == "add") && ($dbTable == "course_description")) 	include (SECTIONS.'display_cd.sec.php'); 
//if (($action == "add") && ($dbTable == "course_project")) 		include (SECTIONS.'display_cpd.sec.php'); 
?>    